﻿<UserControl x:Class="VH.View.AppointmentView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:controls="clr-namespace:VH.UI.UserControls.Controls;assembly=VH.UI.UserControls"
             xmlns:resources="clr-namespace:VH.Resources;assembly=VH.Resources" xmlns:view="clr-namespace:VH.View"
             xmlns:userControls="clr-namespace:VH.UI.UserControls;assembly=VH.UI.UserControls"
             xmlns:helper="clr-namespace:VH.UI.UserControls.Helper;assembly=VH.UI.UserControls"
             xmlns:model="clr-namespace:VH.Model;assembly=VH.Model"
             xmlns:utilities="clr-namespace:VH.Model.Utilities;assembly=VH.Model"
             x:Name="page"
             mc:Ignorable="d">
    <Grid Margin="10,6,0,0">
        <AdornerDecorator>
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="19" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="20" />
                        <RowDefinition />
                        <RowDefinition Height="20" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <ProgressBar x:Name="BrandBar" Grid.Row="0"
                                 Minimum="0" Maximum="100"
                                 HorizontalAlignment="Left" VerticalAlignment="Bottom"
                                 Width="250" Height="6" IsHitTestVisible="False"
                                 Value="100">
                        <ProgressBar.Style>
                            <Style TargetType="ProgressBar" BasedOn="{StaticResource DefaultProgressBarStyle}">
                                <Setter Property="Foreground" Value="{StaticResource AccentColorBlueBrush}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ShowProgressBar}" Value="True">
                                        <Setter Property="Foreground" Value="{StaticResource AccentColorRedBrush}" />
                                        <Setter Property="IsIndeterminate" Value="True" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ProgressBar.Style>
                    </ProgressBar>

                    <Grid Grid.Row="2">
                        <Grid.Resources>
                            <DataTemplate DataType="{x:Type utilities:CheckItem}">
                                <StackPanel Margin="4" Orientation="Horizontal">
                                    <CheckBox IsChecked="{Binding IsChecked, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
                                    <TextBlock Margin="4,0,0,0" Text="{Binding ItemName}" />
                                </StackPanel>
                            </DataTemplate>
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="15" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <controls:VHLabel
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.Date}" />
                        <DatePicker
                            Grid.Column="1"
                            HorizontalAlignment="Left"
                            SelectedDate="{Binding Entity.AppointmentDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                            Validation.ErrorTemplate="{DynamicResource errorTemplateSilverlightStyle}"
                            Width="150" />
                        <controls:VHLabel
                            Grid.Row="2"
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.Name}" />
                        <TextBox
                            Grid.Row="2"
                            Grid.Column="1"
                            x:Name="txtName"
                            HorizontalAlignment="Left"
                            Text="{Binding Entity.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                            Width="200" />
                        <controls:VHLabel
                            Grid.Row="4"
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.ExistingCustomer}" />
                        <TextBox
                            Grid.Row="4"
                            Grid.Column="1"
                            x:Name="txtExistingCustomer"
                            HorizontalAlignment="Left"
                            Text="{Binding Entity.FormattedExistingCustomerName, Mode=OneWay}"
                            Width="200"
                            IsReadOnly="True" />
                        <controls:VHLabel
                            Grid.Row="6"
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.AppointmentType}" />
                        <!--<ComboBox
                        Grid.Row="6"
                        Grid.Column="1"
                        Width="200"
                        HorizontalAlignment="Left"
                        SelectedValue="{Binding Entity.AppointmentType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                        view:VHAttachedProperties.BindEnumToItemSource="VH.Model.AppointmentType, VH.Model" />-->
                        <ComboBox
                            Grid.Row="6"
                            Grid.Column="1"
                            Width="200"
                            HorizontalAlignment="Left"
                            ItemsSource="{Binding CheckItemCollection}">
                            <ComboBox.Template>
                                <ControlTemplate TargetType="ComboBox">
                                    <Grid>
                                        <ToggleButton
                                            x:Name="ToggleButton"
                                            Grid.Column="2"
                                            IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                            Focusable="false"
                                            ClickMode="Press" HorizontalContentAlignment="Left">
                                            <ToggleButton.Template>
                                                <ControlTemplate>
                                                    <Grid>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="*" />
                                                            <ColumnDefinition Width="18" />
                                                        </Grid.ColumnDefinitions>
                                                        <Border
                                                            x:Name="Border"
                                                            Grid.ColumnSpan="2"
                                                            CornerRadius="2"
                                                            Background="White"
                                                            BorderBrush="Black"
                                                            BorderThickness="1,1,1,1" />
                                                        <Border
                                                            x:Name="BorderComp"
                                                            Grid.Column="0"
                                                            CornerRadius="2"
                                                            Margin="1"
                                                            Background="White"
                                                            BorderBrush="Black"
                                                            BorderThickness="0,0,0,0">
                                                            <TextBlock
                                                                Text="{Binding Path=DataContext.SelectedAppointmentTypes, ElementName=page}"
                                                                Background="White" Padding="3" />
                                                        </Border>
                                                        <Path
                                                            x:Name="Arrow"
                                                            Grid.Column="1"
                                                            Fill="Black"
                                                            HorizontalAlignment="Center"
                                                            VerticalAlignment="Center"
                                                            Data="M 0 0 L 4 4 L 8 0 Z" />
                                                    </Grid>
                                                </ControlTemplate>
                                            </ToggleButton.Template>
                                        </ToggleButton>
                                        <Popup
                                            Name="Popup"
                                            Placement="Bottom"
                                            AllowsTransparency="True"
                                            Focusable="False" IsOpen="{TemplateBinding IsDropDownOpen}"
                                            PopupAnimation="Slide">
                                            <Grid
                                                Name="DropDown"
                                                SnapsToDevicePixels="True"
                                                MinWidth="{TemplateBinding ActualWidth}"
                                                MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                                <Border
                                                    x:Name="DropDownBorder"
                                                    BorderThickness="1" Background="White"
                                                    BorderBrush="Black" />
                                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True"
                                                              DataContext="{Binding}">
                                                    <StackPanel IsItemsHost="True"
                                                                KeyboardNavigation.DirectionalNavigation="Contained" />
                                                </ScrollViewer>
                                            </Grid>
                                        </Popup>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="HasItems" Value="false">
                                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
                                        </Trigger>
                                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
                                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </ComboBox.Template>
                        </ComboBox>
                        <controls:VHLabel
                            Grid.Row="8"
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.Time}" />
                        <controls:TimePicker
                            Grid.Row="8"
                            Grid.Column="1"
                            Width="120"
                            Height="30"
                            PopupHeight="100"
                            HorizontalAlignment="Left"
                            Value="{Binding Entity.AppointmentTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                            TimeInterval="{Binding DataContext.DefaultTimeInterval, ElementName=page}"
                            Validation.ErrorTemplate="{DynamicResource errorTemplateSilverlightStyle}"
                            IsValueReadOnly="True" />

                        <!--<controls:VHLabel
                        Grid.Row="10"
                        AddEndingPunctuation="True"
                        Content="{x:Static  resources:LabelResources.AppointmentEndTime}" />
                        <controls:TimePicker
                        Grid.Row="10"
                        Grid.Column="1"
                        Width="120"
                        Height="30"
                        PopupHeight="100"
                        HorizontalAlignment="Left"
                        TimeInterval="{Binding DataContext.DefaultTimeInterval, ElementName=page}"
                        Value="{Binding Entity.EndTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                            Validation.ErrorTemplate="{DynamicResource errorTemplateSilverlightStyle}"
                        IsValueReadOnly="True" />-->

                        <controls:VHLabel
                            Grid.Row="10"
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.PhoneNumber}" />
                        <TextBox Grid.Row="10"
                                 Grid.Column="1"
                                 HorizontalAlignment="Left"
                                 Width="180"
                                 userControls:TextBoxMaskBehavior.Mask="Integer"
                                 MaxLength="11"
                                 Text="{Binding Entity.ContactNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" />

                        <controls:VHLabel
                            Grid.Row="12"
                            AddEndingPunctuation="True"
                            Content="{x:Static  resources:LabelResources.Comment}" />
                        <TextBox Grid.Row="12"
                                 Grid.Column="1"
                                 HorizontalAlignment="Left"
                                 Width="200"
                                 AcceptsReturn="True"
                                 Text="{Binding Entity.Comment, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" />

                        <Grid
                            HorizontalAlignment="Center"
                            Grid.Row="14"
                            Grid.ColumnSpan="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Button
                                Content="{x:Static  resources:ButtonResources.Save}"
                                Command="{Binding SaveCommand}" />
                            <Button
                                Content="{x:Static  resources:ButtonResources.Clear}"
                                Grid.Column="2"
                                Command="{Binding CancelCommand}" />
                        </Grid>
                    </Grid>
                    <Rectangle Grid.Row="3" Fill="{DynamicResource SeparatorBackground}" Height="1.5"
                               HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                    <Grid Grid.Row="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="10" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.Resources>
                            <DataTemplate DataType="{x:Type model:Reminder}">
                                <StackPanel ToolTip="{Binding FormattedReminder}" Width="200">
                                    <TextBlock Text="{Binding ReminderDate, StringFormat=d}" />
                                    <TextBlock Text="{Binding ReminderMessage}" TextWrapping="WrapWithOverflow" />
                                </StackPanel>
                            </DataTemplate>
                        </Grid.Resources>
                        <TextBlock
                            Grid.Row="0"
                            Text="REMINDERS"
                            FontFamily="{StaticResource HeaderFontFamily}" FontSize="{StaticResource HeaderFontSize}"
                            FontWeight="SemiBold" />

                        <ListBox
                            Grid.Row="2"
                            ItemsSource="{Binding ReminderList.ObservableList}" />
                    </Grid>

                </Grid>

                <!-- seperator -->
                <Rectangle Grid.Column="1" Margin="10,0,0,10" Fill="{DynamicResource SeparatorBackground}" Width="1.5"
                           HorizontalAlignment="Center" VerticalAlignment="Stretch" />

                <Grid Grid.Column="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="5" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="3" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="3" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <userControls:ModernButton
                            ControlHeight="30"
                            ControlWidth="30"
                            IconWidth="20"
                            IconHeight="20"
                            IconData="F1 M 14.1415,21.4294L 21.5275,28.8153L 18.8063,31.5365L 11.4204,24.1506L 14.1415,21.4294 Z M 10.8373,23.5675L 9.28239,22.3201C 8.78374,21.8215 8.97811,20.7619 9.47675,20.2632L 10.2542,19.4858C 10.7529,18.9871 11.6992,18.7928 12.1979,19.2914L 13.5584,20.8464L 10.8373,23.5675 Z M 22.7001,33.0914L 19.3894,32.1196L 22.1105,29.3984L 23.0193,32.7722L 22.7001,33.0914 Z M 25,10C 26.3807,10 27.5,11.1193 27.5,12.5L 27.45,13L 35,13L 35,36L 15,36L 15,30L 17,32L 17,34L 33,34L 33,15L 29.5,15L 31,18L 19,18L 20.5,15L 17,15L 17,22L 15,20L 15,13L 22.55,13L 22.5,12.5C 22.5,11.1193 23.6193,10 25,10 Z M 25,11.5C 24.4477,11.5 24,11.9477 24,12.5C 24,12.6822 24.0487,12.8529 24.1338,13L 25.8662,13C 25.9513,12.8529 26,12.6822 26,12.5C 26,11.9477 25.5523,11.5 25,11.5 Z "
                            Margin="15,0,0,10"
                            ToolTip="{x:Static resources:TooltipResources.EditAppointment}"
                            Command="{Binding EditCommand}" />

                        <userControls:ModernButton
                            Grid.Column="2"
                            ControlHeight="30"
                            ControlWidth="30"
                            IconWidth="20"
                            IconHeight="20"
                            IconData="F1 M 16,15L 32,15C 32.5523,15 32.75,17.25 32.75,17.25L 15.25,17.25C 15.25,17.25 15.4477,15 16,15 Z M 22.5,12.5L 25.5,12.5C 25.7761,12.5 26.5,13.2239 26.5,13.5C 26.5,13.7762 25.7761,14.5 25.5,14.5L 22.5,14.5C 22.2238,14.5 21.5,13.7762 21.5,13.5C 21.5,13.2239 22.2238,12.5 22.5,12.5 Z M 17.5,18L 30.5,18C 31.0523,18 31.5,18.4477 31.5,19L 30.5,34C 30.5,34.5523 30.0523,35 29.5,35L 18.5,35C 17.9477,35 17.5,34.5523 17.5,34L 16.5,19C 16.5,18.4477 16.9477,18 17.5,18 Z M 19,20L 19.25,33L 21,33L 20.75,20L 19,20 Z M 23,20L 23,33L 25,33L 25,20L 23,20 Z M 27.25,20L 27,33L 28.75,33L 29,20L 27.25,20 Z "
                            Margin="0,0,0,10"
                            ToolTip="{x:Static resources:TooltipResources.DeleteAppointment}"
                            Command="{Binding DeleteCommand}" />

                        <userControls:ModernButton
                            Grid.Column="4"
                            ControlHeight="30"
                            ControlWidth="30"
                            IconWidth="20"
                            IconHeight="20"
                            IconData="M20.449749,20.277999 C18.796769,21.435999 16.863793,22.016999 14.886817,21.989999 14.625821,21.986999 14.365824,21.973999 14.109827,21.950999 14.004828,21.940999 13.899829,21.923999 13.794831,21.910999 13.592833,21.883999 13.390836,21.856999 13.193838,21.818999 13.07284,21.795999 12.953841,21.764999 12.834843,21.736999 12.641845,21.691999 12.449847,21.645999 12.26185,21.589999 12.170851,21.561999 12.082852,21.529999 11.992853,21.499999 11.775856,21.426999 11.559858,21.351999&#xd;&#xa;11.349861,21.263999 11.301861,21.244999 11.255862,21.221999 11.208862,21.200999 10.962866,21.092999 10.719868,20.978999 10.484871,20.851999 10.473872,20.845999 10.463872,20.840999 10.452872,20.834999 9.6578815,20.397999 8.9298904,19.852999 8.2918983,19.215999 8.2818984,19.205999 8.2718985,19.193999 8.2608987,19.182999 8.0629011,18.983999 7.8739034,18.775999 7.6939056,18.558999 7.6559061,18.512999 7.6199065,18.462999 7.581907,18.415999 6.2829229,16.790999&#xd;&#xa;5.4999325,14.734 5.4999325,12.497 L7.9999019,12.497 3.9999509,6.497 0,12.497 2.4999693,12.497 C2.4999693,15.126999 3.3199593,17.564999 4.7129422,19.580999 4.729942,19.608999 4.7419418,19.638999 4.7609416,19.666999 4.9049398,19.872999 5.0649379,20.062999 5.219936,20.257999 5.2779352,20.331999 5.3319346,20.407999 5.3919338,20.479999 5.6199311,20.756999 5.8619281,21.016999 6.110925,21.270999 6.1349247,21.295999 6.1569245,21.320999 6.1799242,21.343999 7.0159139,22.180999 7.9609023,22.885999 8.9888897,23.449999 9.0158894,23.465999 9.0428891,23.481999&#xd;&#xa;9.0718887,23.496999 9.3678851,23.655999 9.6718813,23.799999 9.9808775,23.935999 10.057877,23.968999 10.132876,24.005999 10.210875,24.038999 10.474871,24.147999 10.745868,24.243999 11.018865,24.334999 11.147863,24.378999 11.275862,24.423999 11.40686,24.463999 11.645857,24.534999 11.889854,24.593999 12.135851,24.651999 12.298849,24.689999 12.460847,24.730999 12.626845,24.762999 12.695844,24.776999 12.760843,24.797999 12.828843,24.808999 13.06084,24.849999&#xd;&#xa;13.293837,24.872999 13.525834,24.900999 13.609833,24.910999 13.691832,24.924999 13.775831,24.933999 14.192826,24.974999 14.608821,25.001999 15.023816,25.001999 17.564785,25.001999 20.043754,24.224999 22.170728,22.734999 22.84872,22.258999 23.013718,21.324999 22.538723,20.645999 22.062729,19.965999 21.126741,19.801999 20.449749,20.277999 M27.501023,12.496999 C27.500023,9.8749991 26.685032,7.4419993 25.299045,5.4299995 25.279046,5.3959995 25.265046,5.3609995 25.242046,5.3289995 25.070048,5.0829996 24.88205,4.8539996 24.695051,4.6239996 24.673052,4.5959996 24.653052,4.5669996 24.630052,4.5389996 23.362065,2.9999997 21.769081,1.8109998 19.964099,1.0339999 19.914099,1.0119999 19.8651,0.98799992 19.8151,0.96699992 19.527103,0.84799993 19.232106,0.74299994 18.935109,0.64399995 18.82811,0.60899995 18.723111,0.56999996&#xd;&#xa;18.614112,0.53799996 18.355115,0.45999997 18.093117,0.39599997 17.82812,0.33499998 17.682122,0.30099998 17.536123,0.26399999 17.388124,0.23499999 17.315125,0.22099999 17.246126,0.19899999 17.174127,0.18599999 16.976129,0.152 16.778131,0.137 16.580133,0.111 16.443134,0.094000001 16.309135,0.073000003 16.171137,0.059000004 15.83914,0.028000007 15.509143,0.015000008 15.179147,0.0090000084 15.119147,0.0090000084 15.061148,9.1552508E-09 15.001148,9.1552508E-09 14.990148,9.1552508E-09&#xd;&#xa;14.980149,0.0030000089 14.969149,0.0040000088 12.431174,0.0060000086 9.9571988,0.77199994 7.83322,2.2599998 7.1542268,2.7349998 6.9892285,3.6699997 7.4642237,4.3489996 7.938219,5.0279996 8.8752096,5.1929995 9.5532028,4.7169996 11.194186,3.5679997 13.108167,2.9859997 15.071148,3.0039997 15.353145,3.0059997 15.631142,3.0199997 15.906139,3.0459997 15.990138,3.0549997 16.074138,3.0679997 16.158137,3.0779997 16.384135,3.1059997 16.608132,3.1379997 16.82813,3.1809997&#xd;&#xa;16.926129,3.1999997 17.022128,3.2249997 17.117127,3.2469997 17.334125,3.2959997 17.550123,3.3479997 17.761121,3.4119997 17.82812,3.4329997 17.894119,3.4569997 17.961119,3.4789997 18.202116,3.5579997 18.440114,3.6429997 18.673112,3.7399997 18.697111,3.7499997 18.721111,3.7619997 18.744111,3.7719997 20.142097,4.3729996 21.368085,5.2989995 22.325075,6.4569994 22.331075,6.4639994 22.337075,6.4729994 22.343075,6.4799994 23.689061,8.1189993 24.500053,10.214999&#xd;&#xa;24.501053,12.496999 L22.000078,12.496999 26.001038,18.496998 29.999998,12.496999 z"
                            Margin="0,0,0,10"
                            ToolTip="{x:Static resources:TooltipResources.RefreshCustomer}"
                            Command="{Binding RefreshCommand}" />
                    </Grid>
                    <DataGrid
                        Grid.Row="2"
                        Name="dgAppointments"
                        ItemsSource="{Binding AppointmentCollection.ObservableList}"
                        AutoGenerateColumns="False"
                        IsReadOnly="True"
                        SelectionMode="Extended">
                        <DataGrid.Resources>
                            <!--<Style TargetType="DataGridCell" BasedOn="{StaticResource DefaultDataGridCellStyle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsAppointmentOverlapped}" Value="True">
                                        <Setter Property="Foreground" Value="Red"/>
                                        <Setter Property="ToolTip" Value="Appointment Time Overlaps"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>-->
                            <helper:BindingProxy x:Key="proxy" Data="{Binding DataContext, ElementName=page}" />
                        </DataGrid.Resources>

                        <DataGrid.ItemContainerStyle>
                            <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource DefaultDataGridRowStyle}">
                                <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                                <Setter Property="ContextMenu">
                                    <Setter.Value>
                                        <ContextMenu>
                                            <MenuItem Header="{x:Static resources:TooltipResources.Edit}"
                                                      Command="{Binding Source={StaticResource proxy}, Path=Data.EditCommand}" />
                                            <MenuItem Header="{x:Static resources:TooltipResources.Delete}"
                                                      Command="{Binding Source={StaticResource proxy}, Path=Data.DeleteCommand}" />
                                        </ContextMenu>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="FontWeight" Value="Bold" />
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </DataGrid.ItemContainerStyle>

                        <DataGrid.Columns>
                            <DataGridTextColumn
                                MinWidth="200"
                                Header="{x:Static  resources:LabelResources.Name}"
                                Binding="{Binding Name}" ElementStyle="{StaticResource DataGridTextStyle}" />
                            <DataGridTextColumn
                                MinWidth="150"
                                Header="{x:Static  resources:LabelResources.AppointmentType}"
                                Binding="{Binding AppointmentType}"
                                ElementStyle="{StaticResource DataGridTextStyle}" />
                            <DataGridTextColumn
                                MinWidth="120"
                                Header="{x:Static  resources:LabelResources.Date}"
                                Binding="{Binding AppointmentDate, StringFormat=d}"
                                ElementStyle="{StaticResource DataGridTextStyle}" />
                            <DataGridTextColumn
                                MinWidth="180"
                                Header="{x:Static  resources:LabelResources.Time}"
                                Binding="{Binding AppointmentTime,  StringFormat=t}"
                                ElementStyle="{StaticResource DataGridTextStyle}" />
                            <DataGridTextColumn
                                MinWidth="120"
                                Header="{x:Static  resources:LabelResources.GridPhoneNumber}"
                                Binding="{Binding ContactNumber}"
                                ElementStyle="{StaticResource DataGridTextStyle}" />
                            <DataGridTextColumn
                                MinWidth="120"
                                Header="{x:Static  resources:LabelResources.Comment}"
                                Binding="{Binding Comment}"
                                ElementStyle="{StaticResource DataGridTextStyle}">
                                <DataGridTextColumn.CellStyle>
                                    <Style TargetType="DataGridCell">
                                        <Setter Property="ToolTip" Value="{Binding Comment}" />
                                    </Style>
                                </DataGridTextColumn.CellStyle>
                            </DataGridTextColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </Grid>
        </AdornerDecorator>
    </Grid>
</UserControl>
